<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>快速上手 | 微观世界</title>
    <meta name="generator" content="VuePress 1.5.0">
    <link rel="icon" href="/logo.jpg">
    <link rel="manifest" href="/manifest.json">
    <meta name="description" content="计算机软件 + 物联网 + 云计算项目开发、设计、咨询">
    <meta name="theme-color" content="#3eaf7c">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="msapplication-TileImage" content="/icons/msapplication-icon-144x144.png">
    <meta name="msapplication-TileColor" content="#000000">
    <link rel="preload" href="/assets/css/0.styles.55f00579.css" as="style"><link rel="preload" href="/assets/js/app.92627f89.js" as="script"><link rel="preload" href="/assets/js/2.817fcd47.js" as="script"><link rel="preload" href="/assets/js/5.addf51f6.js" as="script"><link rel="prefetch" href="/assets/js/10.791ab255.js"><link rel="prefetch" href="/assets/js/11.1dc01403.js"><link rel="prefetch" href="/assets/js/12.c421b677.js"><link rel="prefetch" href="/assets/js/13.8fa15714.js"><link rel="prefetch" href="/assets/js/14.2cca4cf4.js"><link rel="prefetch" href="/assets/js/15.e9f5696c.js"><link rel="prefetch" href="/assets/js/16.62cab094.js"><link rel="prefetch" href="/assets/js/17.6c789b79.js"><link rel="prefetch" href="/assets/js/18.74f9e612.js"><link rel="prefetch" href="/assets/js/19.98ca7c32.js"><link rel="prefetch" href="/assets/js/20.5052a859.js"><link rel="prefetch" href="/assets/js/21.3ea5972a.js"><link rel="prefetch" href="/assets/js/22.18d546b5.js"><link rel="prefetch" href="/assets/js/23.069cf840.js"><link rel="prefetch" href="/assets/js/3.62c9d964.js"><link rel="prefetch" href="/assets/js/4.58e718d2.js"><link rel="prefetch" href="/assets/js/6.a0e5b372.js"><link rel="prefetch" href="/assets/js/7.5d4ccb0f.js"><link rel="prefetch" href="/assets/js/8.ad529520.js"><link rel="prefetch" href="/assets/js/9.cc29df21.js">
    <link rel="stylesheet" href="/assets/css/0.styles.55f00579.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">微观世界</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="成功案例" class="dropdown-title"><span class="title">成功案例</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/product/smart-home/" class="nav-link">
  智能家居
</a></li><li class="dropdown-item"><!----> <a href="/product/share-ark/" class="nav-link">
  共享快递柜
</a></li><li class="dropdown-item"><!----> <a href="/product/share-washing/" class="nav-link">
  共享洗衣机
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="开源项目" class="dropdown-title"><span class="title">开源项目</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ws-cloud/gateway/" class="nav-link router-link-active">
  ws-cloud-gateway
</a></li></ul></div></div><div class="nav-item"><a href="/contact/" class="nav-link">
  联系我们
</a></div><div class="nav-item"><a href="/about/" class="nav-link">
  关于我们
</a></div><div class="nav-item"><a href="/link/" class="nav-link">
  友情链接
</a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="成功案例" class="dropdown-title"><span class="title">成功案例</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/product/smart-home/" class="nav-link">
  智能家居
</a></li><li class="dropdown-item"><!----> <a href="/product/share-ark/" class="nav-link">
  共享快递柜
</a></li><li class="dropdown-item"><!----> <a href="/product/share-washing/" class="nav-link">
  共享洗衣机
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="开源项目" class="dropdown-title"><span class="title">开源项目</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ws-cloud/gateway/" class="nav-link router-link-active">
  ws-cloud-gateway
</a></li></ul></div></div><div class="nav-item"><a href="/contact/" class="nav-link">
  联系我们
</a></div><div class="nav-item"><a href="/about/" class="nav-link">
  关于我们
</a></div><div class="nav-item"><a href="/link/" class="nav-link">
  友情链接
</a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>指南</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/ws-cloud/gateway/1.x/" class="sidebar-link">介绍</a></li><li><a href="/ws-cloud/gateway/1.x/getting-started.html" class="active sidebar-link">快速上手</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ws-cloud/gateway/1.x/getting-started.html#环境安装" class="sidebar-link">环境安装</a></li><li class="sidebar-sub-header"><a href="/ws-cloud/gateway/1.x/getting-started.html#启动服务" class="sidebar-link">启动服务</a></li><li class="sidebar-sub-header"><a href="/ws-cloud/gateway/1.x/getting-started.html#测试" class="sidebar-link">测试</a></li><li class="sidebar-sub-header"><a href="/ws-cloud/gateway/1.x/getting-started.html#管理后台（dashboard）" class="sidebar-link">管理后台（dashboard）</a></li></ul></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>插件</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/ws-cloud/gateway/1.x/plugin/" class="sidebar-link">介绍</a></li><li><a href="/ws-cloud/gateway/1.x/plugin/dev.html" class="sidebar-link">插件开发</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>官方插件</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/ws-cloud/gateway/1.x/plugin/official/discovery.html" class="sidebar-link">discovery plugin</a></li><li><a href="/ws-cloud/gateway/1.x/plugin/official/rewrite.html" class="sidebar-link">rewrite plugin</a></li><li><a href="/ws-cloud/gateway/1.x/plugin/official/tracing.html" class="sidebar-link">tracing plugin</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="快速上手"><a href="#快速上手" class="header-anchor">#</a> 快速上手</h1> <h2 id="环境安装"><a href="#环境安装" class="header-anchor">#</a> 环境安装</h2> <ul><li><a href="https://github.com/etcd-io/etcd#getting-started" target="_blank" rel="noopener noreferrer">安装 etcd<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>（必须）</li> <li><a href="http://openresty.org/cn/installation.html" target="_blank" rel="noopener noreferrer">安装 OpenResty<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>（必须）</li> <li><a href="https://blog.fengjx.com/openresty/test-nginx.html" target="_blank" rel="noopener noreferrer">安装 test::nginx<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>（开发需要，跑测试用例）</li> <li><a href="https://github.com/luarocks/luarocks/wiki/Download" target="_blank" rel="noopener noreferrer">安装 luarocks<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> （必须，用来安装项目依赖）</li> <li>安装 luacheck（开发需要，代码风格检查）<div class="language-bash extra-class"><pre class="language-bash"><code>luarocks <span class="token function">install</span> luacheck
</code></pre></div></li> <li><a href="https://nodejs.org/en/download/" target="_blank" rel="noopener noreferrer">安装 nodejs<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>（开发控制面板需要）</li> <li>安装 yarn 或者 npm（开发控制面板需要）
<ul><li>npm（安装 node 自带）</li> <li><a href="https://classic.yarnpkg.com/en/docs/instal" target="_blank" rel="noopener noreferrer">yarn<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></li></ul> <p>环境变量</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># 根据实际安装路径修改</span>
<span class="token builtin class-name">export</span> <span class="token assign-left variable"><span class="token environment constant">PATH</span></span><span class="token operator">=</span><span class="token string">&quot;<span class="token environment constant">$PATH</span>:/usr/local/Cellar/openresty/1.15.8.3_1/nginx/sbin&quot;</span>
<span class="token builtin class-name">export</span> <span class="token assign-left variable"><span class="token environment constant">PATH</span></span><span class="token operator">=</span><span class="token string">&quot;<span class="token environment constant">$PATH</span>:/usr/local/Cellar/openresty/1.15.8.3_1/luajit/bin&quot;</span>
</code></pre></div><p>启动etcd &amp; 修改配置文件 etcd 配置<code>conf/app.json</code></p> <blockquote><p>etcd.http_host 为 etcd 服务访问地址，etcd.data_prefix 为全局 etcd key 前缀，如有必要可修改</p></blockquote> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;appName&quot;</span><span class="token operator">:</span> <span class="token string">&quot;ws-cloud-gateway&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;env&quot;</span><span class="token operator">:</span> <span class="token string">&quot;test&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;etcd&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">&quot;http_host&quot;</span><span class="token operator">:</span> <span class="token string">&quot;http://192.168.41.47:2379&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;data_prefix&quot;</span><span class="token operator">:</span> <span class="token string">&quot;/my/cloud/&quot;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="启动服务"><a href="#启动服务" class="header-anchor">#</a> 启动服务</h2> <p>安装依赖</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">make</span> deps
</code></pre></div><p>初始化数据（也可以跳过，在后台控制面板手动添加）</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">make</span> init
</code></pre></div><p>初始化完成后，可以看下 etcd 数据</p> <div class="language-bash extra-class"><pre class="language-bash"><code>$ etcdctl --endpoints<span class="token operator">=</span><span class="token number">192.168</span>.41.47:2379  get <span class="token string">'/my/cloud'</span> --prefix
/my/cloud/discovery/demo1/127.0.0.1:1024
<span class="token punctuation">{</span><span class="token string">&quot;time&quot;</span>:1594262173977,<span class="token string">&quot;service_name&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;demo1&quot;</span>,<span class="token string">&quot;weight&quot;</span>:1,<span class="token string">&quot;status&quot;</span>:1,<span class="token string">&quot;key&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/demo1\/127.0.0.1:1024&quot;</span>,<span class="token string">&quot;upstream&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;127.0.0.1:1024&quot;</span><span class="token punctuation">}</span>
/my/cloud/discovery/demo1/127.0.0.1:1025
<span class="token punctuation">{</span><span class="token string">&quot;time&quot;</span>:1594262173983,<span class="token string">&quot;service_name&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;demo1&quot;</span>,<span class="token string">&quot;weight&quot;</span>:1,<span class="token string">&quot;status&quot;</span>:1,<span class="token string">&quot;key&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/demo1\/127.0.0.1:1025&quot;</span>,<span class="token string">&quot;upstream&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;127.0.0.1:1025&quot;</span><span class="token punctuation">}</span>
/my/cloud/discovery/demo2/127.0.0.1:1026
<span class="token punctuation">{</span><span class="token string">&quot;time&quot;</span>:1594262173985,<span class="token string">&quot;service_name&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;demo2&quot;</span>,<span class="token string">&quot;weight&quot;</span>:1,<span class="token string">&quot;status&quot;</span>:1,<span class="token string">&quot;key&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/demo2\/127.0.0.1:1026&quot;</span>,<span class="token string">&quot;upstream&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;127.0.0.1:1026&quot;</span><span class="token punctuation">}</span>
/my/cloud/discovery/demo2/127.0.0.1:1027
<span class="token punctuation">{</span><span class="token string">&quot;time&quot;</span>:1594262173988,<span class="token string">&quot;service_name&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;demo2&quot;</span>,<span class="token string">&quot;weight&quot;</span>:1,<span class="token string">&quot;status&quot;</span>:1,<span class="token string">&quot;key&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/demo2\/127.0.0.1:1027&quot;</span>,<span class="token string">&quot;upstream&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;127.0.0.1:1027&quot;</span><span class="token punctuation">}</span>
/my/cloud/discovery/grpc-demo/127.0.0.1:2021
<span class="token punctuation">{</span><span class="token string">&quot;time&quot;</span>:1594262173990,<span class="token string">&quot;service_name&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;grpc-demo&quot;</span>,<span class="token string">&quot;weight&quot;</span>:1,<span class="token string">&quot;status&quot;</span>:1,<span class="token string">&quot;key&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/grpc-demo\/127.0.0.1:2021&quot;</span>,<span class="token string">&quot;upstream&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;127.0.0.1:2021&quot;</span><span class="token punctuation">}</span>
/my/cloud/routes/grpc.hello.*
<span class="token punctuation">{</span><span class="token string">&quot;props&quot;</span>:<span class="token punctuation">{</span><span class="token punctuation">}</span>,<span class="token string">&quot;plugins&quot;</span>:<span class="token punctuation">[</span><span class="token string">&quot;discovery&quot;</span>,<span class="token string">&quot;tracing&quot;</span><span class="token punctuation">]</span>,<span class="token string">&quot;service_name&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;grpc-demo&quot;</span>,<span class="token string">&quot;time&quot;</span>:1594262173905,<span class="token string">&quot;protocol&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;grpc&quot;</span>,<span class="token string">&quot;key&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/grpc.hello.*&quot;</span>,<span class="token string">&quot;status&quot;</span>:1,<span class="token string">&quot;prefix&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/grpc.hello.*&quot;</span><span class="token punctuation">}</span>
/my/cloud/routes/innerapi/demo1/*
<span class="token punctuation">{</span><span class="token string">&quot;props&quot;</span>:<span class="token punctuation">{</span><span class="token string">&quot;rewrite_url_regex&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;^\/innerapi\/(.*)\/&quot;</span>,<span class="token string">&quot;rewrite_replace&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/&quot;</span><span class="token punctuation">}</span>,<span class="token string">&quot;plugins&quot;</span>:<span class="token punctuation">[</span><span class="token string">&quot;discovery&quot;</span>,<span class="token string">&quot;tracing&quot;</span>,<span class="token string">&quot;rewrite&quot;</span><span class="token punctuation">]</span>,<span class="token string">&quot;service_name&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;demo1&quot;</span>,<span class="token string">&quot;time&quot;</span>:1594262173895,<span class="token string">&quot;protocol&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;http&quot;</span>,<span class="token string">&quot;key&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/innerapi\/demo1\/*&quot;</span>,<span class="token string">&quot;status&quot;</span>:1,<span class="token string">&quot;prefix&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/innerapi\/demo1\/*&quot;</span><span class="token punctuation">}</span>
/my/cloud/routes/openapi/demo1/*
<span class="token punctuation">{</span><span class="token string">&quot;props&quot;</span>:<span class="token punctuation">{</span><span class="token string">&quot;rewrite_url_regex&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;^\/openapi\/(.*)\/&quot;</span>,<span class="token string">&quot;rewrite_replace&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/openapi\/&quot;</span><span class="token punctuation">}</span>,<span class="token string">&quot;plugins&quot;</span>:<span class="token punctuation">[</span><span class="token string">&quot;discovery&quot;</span>,<span class="token string">&quot;tracing&quot;</span>,<span class="token string">&quot;rewrite&quot;</span><span class="token punctuation">]</span>,<span class="token string">&quot;service_name&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;demo1&quot;</span>,<span class="token string">&quot;time&quot;</span>:1594262173884,<span class="token string">&quot;protocol&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;http&quot;</span>,<span class="token string">&quot;key&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/openapi\/demo1\/*&quot;</span>,<span class="token string">&quot;status&quot;</span>:1,<span class="token string">&quot;prefix&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/openapi\/demo1\/*&quot;</span><span class="token punctuation">}</span>
/my/cloud/routes/openapi/demo2/*
<span class="token punctuation">{</span><span class="token string">&quot;props&quot;</span>:<span class="token punctuation">{</span><span class="token punctuation">}</span>,<span class="token string">&quot;plugins&quot;</span>:<span class="token punctuation">[</span><span class="token string">&quot;discovery&quot;</span>,<span class="token string">&quot;tracing&quot;</span><span class="token punctuation">]</span>,<span class="token string">&quot;service_name&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;demo2&quot;</span>,<span class="token string">&quot;time&quot;</span>:1594262173901,<span class="token string">&quot;protocol&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;http&quot;</span>,<span class="token string">&quot;key&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/openapi\/demo2\/*&quot;</span>,<span class="token string">&quot;status&quot;</span>:1,<span class="token string">&quot;prefix&quot;</span><span class="token builtin class-name">:</span><span class="token string">&quot;\/openapi\/demo2\/*&quot;</span><span class="token punctuation">}</span>
</code></pre></div><p>启动服务</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">make</span> start
</code></pre></div><h2 id="测试"><a href="#测试" class="header-anchor">#</a> 测试</h2> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># 测试 demo1 服务</span>
<span class="token function">curl</span> http://localhost:10000/openapi/demo1/api
<span class="token function">curl</span> http://localhost:10000/innerapi/demo1/api2

<span class="token comment"># 测试 demo2 服务</span>
<span class="token function">curl</span> http://localhost:10000/openapi/demo2/api
</code></pre></div><h2 id="管理后台（dashboard）"><a href="#管理后台（dashboard）" class="header-anchor">#</a> 管理后台（dashboard）</h2> <p>路由管理</p> <p><img src="/assets/img/routes.46e6ca6a.jpg" alt="路由管理"></p> <p>服务节点管理</p> <p><img src="/assets/img/services.ea90d0f4.jpg" alt="服务节点管理"></p></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/ws-cloud/gateway/1.x/" class="prev router-link-active">
        介绍
      </a></span> <span class="next"><a href="/ws-cloud/gateway/1.x/plugin/">
        介绍
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----></div></div>
    <script src="/assets/js/app.92627f89.js" defer></script><script src="/assets/js/2.817fcd47.js" defer></script><script src="/assets/js/5.addf51f6.js" defer></script>
  </body>
</html>
